﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace YouDaoNotesCodes.JSON
{
    class JsonOthers
    {
        #region JSON去重
        public void distinct()
        {
            List<TestModel> testList = new List<TestModel>();
            testList.Add(new TestModel()
            {
                Index = 1,
                Name = "Index1"
            });
            testList.Add(new TestModel()
            {
                Index = 2,
                Name = "Index2"
            });
            testList.Add(new TestModel()
            {
                Index = 2,
                Name = "Index2"
            });
            testList = testList.Distinct().ToList();
        }
        #endregion
    }
    public struct TestModel
    {
        public int Index { get; set; }
        public string Name { get; set; }
    }
}
